package com.yfqy.admin.enums;

import com.yfqy.admin.constant.MyConstants;
import lombok.Getter;

import java.util.Objects;

@Getter
public enum CategoryLevel {
    LEVEL_1(MyConstants.BT1),
    LEVEL_2(MyConstants.BT2),
    ;


    private final Byte level;

    CategoryLevel(Byte level) {
        this.level = level;
    }

    public static CategoryLevel getLevel(Byte level) {
        for (CategoryLevel value : values()) {
            if (Objects.equals(value.level, level)) {
                return value;
            }
        }
        return null;
    }
}
